import { HttpUtils } from '@/utils/http'

export class stt {
  // 在苏台企分布
  static async getScreenStatisticsEnterpriseInSz(params) {
    const res = await HttpUtils.request({
      url: 'stt/screen/statisticsEnterpriseInSz',
      method: 'GET',
      params
    })
    return res.data
  }

  // 在苏台企总计
  static async getScreenTotalEnterpriseInSz(params) {
    const res = await HttpUtils.request({
      url: 'stt/screen/totalEnterpriseInSz',
      method: 'GET',
      params
    })
    return res.data
  }

  // 年度营收前十企业
  static async getScreenStatisticsEnterpriseRevenue(params) {
    const res = await HttpUtils.request({
      url: 'stt/screen/statisticsEnterpriseRevenue?year='+params.year+'&areaCode='+params.areaCode,
      method: 'GET',
      params
    })
    return res.data
  }

  // 协调服务统计
  static async getScreenStatisticsCoordination(params) {
    const res = await HttpUtils.request({
      url: 'stt/screen/statisticsCoordination',
      method: 'GET',
      params
    })
    return res.data
  }

  // 基地建设活动统计
  static async getScreenStatisticsBaseConstruction(params) {
    const res = await HttpUtils.request({
      url: 'stt/screen/statisticsBaseConstruction',
      method: 'GET',
      params
    })
    return res.data
  }

  // 统计标签下企业数量
  static async getScreenStatisticsEnterpriseTag(params) {
    let res = ''
    if (params==null||params==''){
      console.log(1)
      res = await HttpUtils.request({
        url: 'stt/screen/statisticsEnterpriseTag',
        method: 'GET',
        params
      })
    } else {
      console.log(2)
      res = await HttpUtils.request({
        url: 'stt/screen/statisticsEnterpriseTag?areaCode='+params,
        method: 'GET',
        params
      })
    }

    return res.data
  }

  // 统计各区域涉台人员
  static async getScreenStatisticsPersonnelArea(params) {
    const res = await HttpUtils.request({
      url: 'stt/screen/statisticsPersonnelArea',
      method: 'GET',
      params
    })
    return res.data
  }
}
